package cn.cctvcc.system.service.impl;

import cn.cctvcc.core.utils.SnowIdUtils;
import cn.cctvcc.system.api.domain.SysEmail;
import cn.cctvcc.system.mapper.SysEmailMapper;
import cn.cctvcc.system.service.SysEmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;


/**
 * @description: 邮件管理实现类
 * @author: Jiang
 * @create: 2021-09-28 11:02
 */
@Service
public class SysEmailServiceImpl implements SysEmailService {

    @Autowired
    private SysEmailMapper sysEmailMapper;

    /**
     * 新增
     * @param sysEmail
     * @return
     */
    @Override
    @Transactional
    public SysEmail add(SysEmail sysEmail) {
        sysEmail.setId(SnowIdUtils.uniqueLong());// 获取id
        sysEmail.setCreateBy("");
        sysEmail.setCreateTime(LocalDateTime.now());
        sysEmailMapper.insert(sysEmail);
        return sysEmail;
    }
}
